/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Outage.impl;

import EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl;

import EA_Model.IEC61970.Domain.AbsoluteDateTime;

import EA_Model.IEC61970.Outage.ClearanceTag;
import EA_Model.IEC61970.Outage.OutagePackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Clearance Tag</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getAuthorityName <em>Authority Name</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getDeenergizeReqFlag <em>Deenergize Req Flag</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getGroundReqFlag <em>Ground Req Flag</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getPhaseCheckReqFlag <em>Phase Check Req Flag</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getTagIssueTime <em>Tag Issue Time</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getWorkDescription <em>Work Description</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getWorkEndTime <em>Work End Time</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Outage.impl.ClearanceTagImpl#getWorkStartTime <em>Work Start Time</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ClearanceTagImpl extends IdentifiedObjectImpl implements ClearanceTag {
	/**
	 * The cached value of the '{@link #getAuthorityName() <em>Authority Name</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAuthorityName()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String authorityName;

	/**
	 * The cached value of the '{@link #getDeenergizeReqFlag() <em>Deenergize Req Flag</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeenergizeReqFlag()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean deenergizeReqFlag;

	/**
	 * The cached value of the '{@link #getGroundReqFlag() <em>Ground Req Flag</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroundReqFlag()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean groundReqFlag;

	/**
	 * The cached value of the '{@link #getPhaseCheckReqFlag() <em>Phase Check Req Flag</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPhaseCheckReqFlag()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean phaseCheckReqFlag;

	/**
	 * The cached value of the '{@link #getTagIssueTime() <em>Tag Issue Time</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTagIssueTime()
	 * @generated
	 * @ordered
	 */
	protected AbsoluteDateTime tagIssueTime;

	/**
	 * The cached value of the '{@link #getWorkDescription() <em>Work Description</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getWorkDescription()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String workDescription;

	/**
	 * The cached value of the '{@link #getWorkEndTime() <em>Work End Time</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getWorkEndTime()
	 * @generated
	 * @ordered
	 */
	protected AbsoluteDateTime workEndTime;

	/**
	 * The cached value of the '{@link #getWorkStartTime() <em>Work Start Time</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getWorkStartTime()
	 * @generated
	 * @ordered
	 */
	protected AbsoluteDateTime workStartTime;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ClearanceTagImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return OutagePackage.Literals.CLEARANCE_TAG;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getAuthorityName() {
		if (authorityName != null && authorityName.eIsProxy()) {
			InternalEObject oldAuthorityName = (InternalEObject)authorityName;
			authorityName = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldAuthorityName);
			if (authorityName != oldAuthorityName) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME, oldAuthorityName, authorityName));
			}
		}
		return authorityName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetAuthorityName() {
		return authorityName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAuthorityName(EA_Model.IEC61970.Domain.String newAuthorityName) {
		EA_Model.IEC61970.Domain.String oldAuthorityName = authorityName;
		authorityName = newAuthorityName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME, oldAuthorityName, authorityName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getDeenergizeReqFlag() {
		if (deenergizeReqFlag != null && deenergizeReqFlag.eIsProxy()) {
			InternalEObject oldDeenergizeReqFlag = (InternalEObject)deenergizeReqFlag;
			deenergizeReqFlag = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldDeenergizeReqFlag);
			if (deenergizeReqFlag != oldDeenergizeReqFlag) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG, oldDeenergizeReqFlag, deenergizeReqFlag));
			}
		}
		return deenergizeReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetDeenergizeReqFlag() {
		return deenergizeReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDeenergizeReqFlag(EA_Model.IEC61970.Domain.Boolean newDeenergizeReqFlag) {
		EA_Model.IEC61970.Domain.Boolean oldDeenergizeReqFlag = deenergizeReqFlag;
		deenergizeReqFlag = newDeenergizeReqFlag;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG, oldDeenergizeReqFlag, deenergizeReqFlag));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getGroundReqFlag() {
		if (groundReqFlag != null && groundReqFlag.eIsProxy()) {
			InternalEObject oldGroundReqFlag = (InternalEObject)groundReqFlag;
			groundReqFlag = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldGroundReqFlag);
			if (groundReqFlag != oldGroundReqFlag) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG, oldGroundReqFlag, groundReqFlag));
			}
		}
		return groundReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetGroundReqFlag() {
		return groundReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGroundReqFlag(EA_Model.IEC61970.Domain.Boolean newGroundReqFlag) {
		EA_Model.IEC61970.Domain.Boolean oldGroundReqFlag = groundReqFlag;
		groundReqFlag = newGroundReqFlag;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG, oldGroundReqFlag, groundReqFlag));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getPhaseCheckReqFlag() {
		if (phaseCheckReqFlag != null && phaseCheckReqFlag.eIsProxy()) {
			InternalEObject oldPhaseCheckReqFlag = (InternalEObject)phaseCheckReqFlag;
			phaseCheckReqFlag = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldPhaseCheckReqFlag);
			if (phaseCheckReqFlag != oldPhaseCheckReqFlag) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG, oldPhaseCheckReqFlag, phaseCheckReqFlag));
			}
		}
		return phaseCheckReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetPhaseCheckReqFlag() {
		return phaseCheckReqFlag;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPhaseCheckReqFlag(EA_Model.IEC61970.Domain.Boolean newPhaseCheckReqFlag) {
		EA_Model.IEC61970.Domain.Boolean oldPhaseCheckReqFlag = phaseCheckReqFlag;
		phaseCheckReqFlag = newPhaseCheckReqFlag;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG, oldPhaseCheckReqFlag, phaseCheckReqFlag));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime getTagIssueTime() {
		if (tagIssueTime != null && tagIssueTime.eIsProxy()) {
			InternalEObject oldTagIssueTime = (InternalEObject)tagIssueTime;
			tagIssueTime = (AbsoluteDateTime)eResolveProxy(oldTagIssueTime);
			if (tagIssueTime != oldTagIssueTime) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME, oldTagIssueTime, tagIssueTime));
			}
		}
		return tagIssueTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime basicGetTagIssueTime() {
		return tagIssueTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTagIssueTime(AbsoluteDateTime newTagIssueTime) {
		AbsoluteDateTime oldTagIssueTime = tagIssueTime;
		tagIssueTime = newTagIssueTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME, oldTagIssueTime, tagIssueTime));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getWorkDescription() {
		if (workDescription != null && workDescription.eIsProxy()) {
			InternalEObject oldWorkDescription = (InternalEObject)workDescription;
			workDescription = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldWorkDescription);
			if (workDescription != oldWorkDescription) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION, oldWorkDescription, workDescription));
			}
		}
		return workDescription;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetWorkDescription() {
		return workDescription;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setWorkDescription(EA_Model.IEC61970.Domain.String newWorkDescription) {
		EA_Model.IEC61970.Domain.String oldWorkDescription = workDescription;
		workDescription = newWorkDescription;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION, oldWorkDescription, workDescription));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime getWorkEndTime() {
		if (workEndTime != null && workEndTime.eIsProxy()) {
			InternalEObject oldWorkEndTime = (InternalEObject)workEndTime;
			workEndTime = (AbsoluteDateTime)eResolveProxy(oldWorkEndTime);
			if (workEndTime != oldWorkEndTime) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__WORK_END_TIME, oldWorkEndTime, workEndTime));
			}
		}
		return workEndTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime basicGetWorkEndTime() {
		return workEndTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setWorkEndTime(AbsoluteDateTime newWorkEndTime) {
		AbsoluteDateTime oldWorkEndTime = workEndTime;
		workEndTime = newWorkEndTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__WORK_END_TIME, oldWorkEndTime, workEndTime));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime getWorkStartTime() {
		if (workStartTime != null && workStartTime.eIsProxy()) {
			InternalEObject oldWorkStartTime = (InternalEObject)workStartTime;
			workStartTime = (AbsoluteDateTime)eResolveProxy(oldWorkStartTime);
			if (workStartTime != oldWorkStartTime) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OutagePackage.CLEARANCE_TAG__WORK_START_TIME, oldWorkStartTime, workStartTime));
			}
		}
		return workStartTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime basicGetWorkStartTime() {
		return workStartTime;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setWorkStartTime(AbsoluteDateTime newWorkStartTime) {
		AbsoluteDateTime oldWorkStartTime = workStartTime;
		workStartTime = newWorkStartTime;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OutagePackage.CLEARANCE_TAG__WORK_START_TIME, oldWorkStartTime, workStartTime));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME:
				if (resolve) return getAuthorityName();
				return basicGetAuthorityName();
			case OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG:
				if (resolve) return getDeenergizeReqFlag();
				return basicGetDeenergizeReqFlag();
			case OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG:
				if (resolve) return getGroundReqFlag();
				return basicGetGroundReqFlag();
			case OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG:
				if (resolve) return getPhaseCheckReqFlag();
				return basicGetPhaseCheckReqFlag();
			case OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME:
				if (resolve) return getTagIssueTime();
				return basicGetTagIssueTime();
			case OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION:
				if (resolve) return getWorkDescription();
				return basicGetWorkDescription();
			case OutagePackage.CLEARANCE_TAG__WORK_END_TIME:
				if (resolve) return getWorkEndTime();
				return basicGetWorkEndTime();
			case OutagePackage.CLEARANCE_TAG__WORK_START_TIME:
				if (resolve) return getWorkStartTime();
				return basicGetWorkStartTime();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME:
				setAuthorityName((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG:
				setDeenergizeReqFlag((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG:
				setGroundReqFlag((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG:
				setPhaseCheckReqFlag((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME:
				setTagIssueTime((AbsoluteDateTime)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION:
				setWorkDescription((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_END_TIME:
				setWorkEndTime((AbsoluteDateTime)newValue);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_START_TIME:
				setWorkStartTime((AbsoluteDateTime)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME:
				setAuthorityName((EA_Model.IEC61970.Domain.String)null);
				return;
			case OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG:
				setDeenergizeReqFlag((EA_Model.IEC61970.Domain.Boolean)null);
				return;
			case OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG:
				setGroundReqFlag((EA_Model.IEC61970.Domain.Boolean)null);
				return;
			case OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG:
				setPhaseCheckReqFlag((EA_Model.IEC61970.Domain.Boolean)null);
				return;
			case OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME:
				setTagIssueTime((AbsoluteDateTime)null);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION:
				setWorkDescription((EA_Model.IEC61970.Domain.String)null);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_END_TIME:
				setWorkEndTime((AbsoluteDateTime)null);
				return;
			case OutagePackage.CLEARANCE_TAG__WORK_START_TIME:
				setWorkStartTime((AbsoluteDateTime)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case OutagePackage.CLEARANCE_TAG__AUTHORITY_NAME:
				return authorityName != null;
			case OutagePackage.CLEARANCE_TAG__DEENERGIZE_REQ_FLAG:
				return deenergizeReqFlag != null;
			case OutagePackage.CLEARANCE_TAG__GROUND_REQ_FLAG:
				return groundReqFlag != null;
			case OutagePackage.CLEARANCE_TAG__PHASE_CHECK_REQ_FLAG:
				return phaseCheckReqFlag != null;
			case OutagePackage.CLEARANCE_TAG__TAG_ISSUE_TIME:
				return tagIssueTime != null;
			case OutagePackage.CLEARANCE_TAG__WORK_DESCRIPTION:
				return workDescription != null;
			case OutagePackage.CLEARANCE_TAG__WORK_END_TIME:
				return workEndTime != null;
			case OutagePackage.CLEARANCE_TAG__WORK_START_TIME:
				return workStartTime != null;
		}
		return super.eIsSet(featureID);
	}

} //ClearanceTagImpl
